package com.justech.eat.mapper.mysql;


import com.justech.eat.controller.req.OrderDayCount;
import com.justech.eat.entity.Order;
import com.justech.eat.entity.OrderDetail;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;


public interface OrderDetailMapper {
    Integer add(OrderDetail orderDetail);

    Integer deleteById(long id);

    Integer update(OrderDetail orderDetail);

    OrderDetail queryById(long id);

    OrderDetail queryByOrderId(long orderId);

    OrderDetail selectPage(long orderId);

    @Select("SELECT * FROM e_order a LEFT JOIN e_order_detail b ON a.id=b.order_id WHERE a.date=#{date} AND a.job_number=#{jobNumber} AND b.type=#{type}\n")
    OrderDetail findOne(String date, String jobNumber, int type);

    List<Map<Integer, Integer>> findAllDetail(String date);

    List<OrderDetail> findByOrderId(Long orderId);

    /*  List<OrderDayCount> queryDetails(OrderDayCount orderDayCount);*/

}
